<!--%import("filter/insert_question.xml")-->
<!--%import("js/quiz.js")-->
<!--#include("header.html")-->
<script type="text/javascript">
	jQuery(document).ready(function() { 
		(function($){
			// Dialog			
			$('#activation_date').datepicker({ dateFormat: 'yymmdd' });

			$('#question_type').change(function() {
				  $('#answer_row').toggle();
				});

		})(jQuery);
	});
</script>
<form action="./" method="post" onsubmit="return procFilter(this, insert_question)" enctype="multipart/form-data">
<input type="hidden" name="module_srl" value="{$module_info->module_srl}" />
<input type="hidden" name="question_srl" value="{$question_srl}" />
<table cellspacing="0" class="rowTable">
    <tr>
        <th scope="row"><div>{$lang->question_title}</div></th>
        <td>
            <textarea name="title" class="inputTypeTextArea fullWidth" id="title">{htmlspecialchars($question->getTitle())}</textarea>
            <a href="{getUrl('','module','module','act','dispModuleAdminLangcode','target','title')}" onclick="popopen(this.href);return false;" class="buttonSet buttonSetting"><span>{$lang->cmd_find_langcode}</span></a>
            <p>{$lang->about_question_title}</p>
        </td>
    </tr>
    <tr>
        <th scope="row"><div>{$lang->question_description}</div></th>
        <td>
            <textarea name="description" class="inputTypeTextArea fullWidth" id="description">{htmlspecialchars($question->getDescription())}</textarea>
            <a href="{getUrl('','module','module','act','dispModuleAdminLangcode','target','description')}" onclick="popopen(this.href);return false;" class="buttonSet buttonSetting"><span>{$lang->cmd_find_langcode}</span></a>
            <p>{$lang->about_question_description}</p>
        </td>
    </tr>
    <tr>
        <th scope="row"><div>{$lang->question_hint}</div></th>
        <td>
            <textarea name="hint" class="inputTypeTextArea fullWidth" id="hint">{htmlspecialchars($question->getHint())}</textarea>
            <a href="{getUrl('','module','module','act','dispModuleAdminLangcode','target','hint')}" onclick="popopen(this.href);return false;" class="buttonSet buttonSetting"><span>{$lang->cmd_find_langcode}</span></a>
            <p>{$lang->about_question_hint}</p>
        </td>
    </tr>    
    <tr id="question_type">
        <th scope="row"><div>{$lang->type}</div></th>
        <td>
            <select name="is_multiple_choice">
            	<option value="N" <!--@if(!$question->isMultipleChoice())-->selected<!--@end-->>{$lang->open_answer}</option>
            	<option value="Y" <!--@if($question->isMultipleChoice())-->selected<!--@end-->>{$lang->multiple_choice}</option>
            </select>
            <p>{$lang->about_type}</p>
        </td>
    </tr>    
    <tr id="answer_row" style="<!--@if($question->isMultipleChoice())-->display:none<!--@end-->">
        <th scope="row"><div>{$lang->answer}</div></th>
        <td>
            <textarea name="answer" class="inputTypeTextArea fullWidth" id="answer"><!--@if(!is_null($question->getQuestionSrl()) && !$question->isMultipleChoice())-->{htmlspecialchars($question->getAnswer())}<!--@end--></textarea>
            <a href="{getUrl('','module','module','act','dispModuleAdminLangcode','target','answer')}" onclick="popopen(this.href);return false;" class="buttonSet buttonSetting"><span>{$lang->cmd_find_langcode}</span></a>
            <p>{$lang->about_answer}</p>
        </td>
    </tr>    
    <!--@if($module_info->use_question_activation_date == 'Y') -->
    <tr>
        <th scope="row"><div>{$lang->activation_date}</div></th>
        <td>
            <input type="text" name="activation_date" value="{htmlspecialchars($question->getActivationDate())}"  class="inputTypeText" id="activation_date"/>
            <p>{$lang->about_activation_date}</p>
        </td>
    </tr>     
    <!--@end -->           
    <tr>
        <th scope="row"><div>{$lang->question_weight}</div></th>
        <td>
            <input type="text" name="weight" value="{htmlspecialchars($question->getWeight())}"  class="inputTypeText w400" id="weight"/>
            <p>{$lang->about_question_weight}</p>
        </td>
    </tr>        
    <tr>
        <th scope="row"><div>{$lang->list_order}</div></th>
        <td>
            <input type="text" name="list_order" value="{htmlspecialchars($question->getListOrder())}"  class="inputTypeText w400" id="list_order"/>
            <p>{$lang->question_list_order}</p>
        </td>
    </tr>            
    <tr>
        <th colspan="2" class="button">
            <span class="button black strong"><input type="submit" value="{$lang->cmd_registration}" accesskey="s" /></span>
            <span class="button"><input type="button" value="{$lang->cmd_back}" onclick="history.back(); return false;" /></span>
        </th>
	</tr>
    
</table>    
</form>